import { type FormItemProps } from 'ant-design-vue'

export type ComppnentEl = 'a-input' | 'a-input-number' | 'a-select' | 'a-date-picker' | 'a-time-picker' | 'a-radio-group' | 'a-checkbox-group' | 'a-switch' | 'a-slider' | 'a-tree-select' | 'a-cascader' | 'a-textarea' | 'a-upload' | 'a-input-password' | 'a-input-search' | 'a-input-group'

export interface Fields {
  key: string,
  el: ComppnentEl,
  label?: string,
  span?: number,
  attrs?: Record<string, any>,
  colAttrs?: {
    span: number
  },
  // a-form-item 原生属性， 自己看 文档
  formItemAttrs?: FormItemProps,
  labelWidth?: number
  width?: number,
  on?: Record<string, any>,
}

export interface Props {
  form?: any,
  fields: Fields[],
  layout?: string,
  searchText?: string
  cancelText?: string
  // 权限
  auth?: string
}
